package com.campus.backend.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.campus.backend.entity.Merchant;
import com.campus.backend.entity.MerchantApply;
import com.campus.backend.mapper.MerchantApplyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 商户入驻申请表 服务实现类
 * </p>
 *
 * @author ZhaoYuJie
 * @since 2025-05-21
 */
@Service
public class MerchantApplyService extends ServiceImpl<MerchantApplyMapper, MerchantApply> {

    @Autowired
    private MerchantService merchantService;

    @Transactional(rollbackFor = Exception.class)
    public void auditMerchantApplyTransaction(MerchantApply merchantApply, Merchant merchant) {
        this.updateById(merchantApply);
        merchantService.save(merchant);
    }
}
